import con from 'public/apiConfig'
import { Message } from 'iview'
import 'iview/dist/styles/iview'



export default {
    getSection: () =>
        con.iHttp('get', `${con.api}/webapi/Community/TopicItems`).then((data) => {
            return data.data
        }).catch(err => Message.error(`${err}`)),
    getCommunity_article: (params) =>
        con.iHttp('get', (`${con.api}/webapi/Community?ClassId=${params.id}
        &Sord=${params.Sord}&Index=${params.index}
        &Limit=${params.limit}`).replace(/\s+/g, '')).then((data) => {
            return data.data
        }),
    getPlace: (item) =>
        con.iHttp('get', `${con.api}/webapi/Other/GetCity?Pid=${item}`).then((data) => {
            return data.data
        }),
    postRegister: (item) =>
        con.iHttp('post', `${con.api}/webapi/User/Register`, item).then((data) => {
            console.log(data)
        }),
    postLogin: (item) =>
        con.iHttp('post', `${con.api}/webapi/User/Login`, item).then((data) => {
            return data
        }),
    updateReadNum: (item) =>
        con.iHttp('post', `${con.api}/webapi/Community/UpdateReadNum`, item).then((data) => {
            console.log(data)
        })

}